<?php
/* 
 * 注册新用户操作
 */
 require_once '../comm/user.dao.php';
$msg = "";
$psw = $_POST["password"];
 if(isset($_POST["user"])){
     $rs = addUser($_POST["user"], ($_POST["password"]),$_POST["head"]);
     //$rs = addUser($_POST["user"], md5($_POST["password"]), $_POST["head"]);//使用md5对从表单获取的密码加密
	 if($rs <= 0){
         $msg = "用户注册失败";
     }else{
         header("location: ../login.php?password=$psw");
         return ;
     }
  }else{
      $msg = "用户名不能为空";
  }
  header("location: ../error.php?msg=$msg");
?>
